package com.cndw.kungfu.model.pvp.camp;

import java.util.Comparator;

public class CampComparator implements Comparator<CampWarPlayer> {

	@Override
	public int compare(CampWarPlayer o1, CampWarPlayer o2) {
		int diff = o2.getStreak() - o1.getStreak();
		if (diff == 0) {
			diff = o2.getWin() - o1.getWin();
			if (diff == 0) {
				diff = o2.getBuff() - o1.getBuff();
				if (diff == 0) {
					diff = o2.getSourceObj().getScore() - o1.getSourceObj().getScore();
					if (diff ==0) {
						if (o2.getSourceObj().getPlayerId() > o1.getSourceObj().getPlayerId()) {
							diff = 1;
						}else {
							diff = -1;
						}
					}
				}
			}
		}
		return diff;
	}

}
